package core.hxl.service;

import core.hxl.stream.MessageObject;
import core.hxl.stream.MessageStreams;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

@Component
public class MessageListener {

    /*
    * 消费失败如何处理
    * */
    @StreamListener(MessageStreams.INPUT)
    public void receiveMessage(@Payload MessageObject messageObject){
        System.out.println("Received Message: mess=>"+messageObject.getMess()+" time=>"+messageObject.getTime());
    }

}
